/* ==================
          常用工具
 ==================== */
 @import "@/uni.scss";
 
 .tabbar-height {
 	height: $tabbar-height;
 }

.ss-bg-opactity-block {
  background-color: rgba(#000, 0.2);
  color: #fff;
}

.borde-b-e{
	border-bottom: 1rpx solid #EEEEEE;
}
.del_text {
	text-decoration: line-through;
}

.no_wrap {
  white-space: nowrap;
}
.word-break {
	white-space:normal;  //规定段落中的文本不进行换行
	word-break:break-word; //如果不想单词内断行可以进行单词间的断行
}


.ss-bottom-box {
	position: fixed;
	bottom: 0;
	left: 0;
	width: 100%;
	box-sizing: border-box;
	background-color: #fff;
	padding: 16rpx 32rpx calc(env(safe-area-inset-bottom)) 32rpx;
	border: 2rpx solid rgba(0,0,0,0.05)
}

.box-sizing {
	box-sizing: border-box;
}

/* ==================
          flex布局
 ==================== */

.ss-flex {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.flex {
	display: flex;
}

.ss-flex-1 {
  flex: 1;
}

.ss-flex-col {
  display: flex;
  flex-direction: column;
}

.ss-flex-wrap {
  flex-wrap: wrap;
}

.ss-flex-nowrap {
  flex-wrap: nowrap;
}

.ss-col-center {
  align-items: center;
}

.ss-col-top {
  align-items: flex-start;
}

.ss-col-bottom {
  align-items: flex-end;
}

.ss-col-stretch {
  align-items: stretch;
}

.ss-row-center {
  justify-content: center;
}

.ss-row-left {
  justify-content: flex-start;
}

.ss-row-right {
  justify-content: flex-end;
}

.ss-row-between {
  justify-content: space-between;
}

.ss-row-around {
  justify-content: space-around;
}

.ss-self-start {
  align-self: flex-start;
}

.ss-self-end {
  align-self: flex-end;
}

.ss-self-center {
  align-self: center;
}
.ss-h-100 {
  height: 100%;
}
.ss-w-100 {
  width: 100%;
}

.ss-text-center {
	text-align: center;
}
.ss-text-left {
	text-align: left;
}
.ss-text-right {
	text-align: right;
}

.border {
	border: 1rpx solid $border-color;
}
.dotted-border {
	border: 1rpx dotted $border-color;
}

.under-line {
	text-decoration: underline;
}

/* ==================

    margin padding: 内外边距
	
 ==================== */
@for $i from 1 through 100 {
  // 只要双数和能被5除尽的数
  @if $i % 2==0 or $i % 5==0 {
    // 得出：u-margin-30或者u-m-30
    .ss-margin-#{$i},
    .ss-m-#{$i} {
      margin: $i + rpx;
    }
    .ss-m-x-#{$i} {
      margin-left: $i + rpx;
      margin-right: $i + rpx;
    }
    .ss-m-y-#{$i} {
      margin-top: $i + rpx;
      margin-bottom: $i + rpx;
    }

    // 得出：u-padding-30或者u-p-30
    .ss-padding-#{$i},
    .ss-p-#{$i} {
      padding: $i + rpx;
    }
    .ss-p-x-#{$i} {
      padding-left: $i + rpx;
      padding-right: $i + rpx;
    }
    .ss-p-y-#{$i} {
      padding-top: $i + rpx;
      padding-bottom: $i + rpx;
    }
	
	.ss-gap-#{$i},
	.gap-#{$i}{
		gap:$i + rpx;
	}
	
	.ss-flex-#{$i} {
		flex:$i;
	}

    @each $short, $long in l left, t top, r right, b bottom {
      // 缩写版，结果如： u-m-l-30
      // 定义外边距
      .ss-m-#{$short}-#{$i} {
        margin-#{$long}: $i + rpx;
      }

      // 定义内边距
      .ss-p-#{$short}-#{$i} {
        padding-#{$long}: $i + rpx;
      }

      // 完整版，结果如：u-margin-left-30
      // 定义外边距
      .ss-margin-#{$long}-#{$i} {
        margin-#{$long}: $i + rpx;
      }

      // 定义内边距
      .ss-padding-#{$long}-#{$i} {
        padding-#{$long}: $i + rpx;
      } 
    }
  }
}

/* ==================

    radius
	
 ==================== */
@for $i from 0 through 100 {
  // 只要双数和能被5除尽的数
  @if $i % 2==0 or $i % 5==0 {
    .ss-radius-#{$i},
	.br-#{$i} {
      border-radius: $i + rpx;
    }
    .ss-r-#{$i} {
      border-radius: $i + rpx;
    }

    .ss-r-t-#{$i} {
      border-top-left-radius: $i + rpx;
      border-top-right-radius: $i + rpx;
    }

    .ss-r-b-#{$i} {
      border-bottom-left-radius: $i + rpx;
      border-bottom-right-radius: $i + rpx;
    }

    @each $short, $long in tl 'top-left', tr 'top-right', bl 'bottom-right', br 'bottom-right' {
      // 定义外边距
      .ss-r-#{$short}-#{$i} {
        border-#{$long}-radius: $i + rpx;
      }

      // 定义内边距
      .ss-radius-#{$long}-#{$i} {
        border-#{$long}-radius: $i + rpx;
      }
    }
  }
}

/* ==================

    溢出省略号
    @param {Number} 行数
	
 ==================== */
@mixin ellipsis($rowCount: 1) {
  // @if $rowCount <=1 {
  //   overflow: hidden;
  //   text-overflow: ellipsis;
  //   white-space: nowrap;
  // } @else {
  //   min-width: 0;
  //   overflow: hidden;
  //   text-overflow: ellipsis;
  //   display: -webkit-box;
  //   -webkit-line-clamp: $rowCount;
  //   -webkit-box-orient: vertical;
  // }
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $rowCount;
  -webkit-box-orient: vertical;
}

@for $i from 1 through 6 {
  .ss-line-#{$i} {
    @include ellipsis($i);
  }
}

.opc-5 {
	opacity: 0.5;
}
.opc-6 {
	opacity: 0.6;
}
.opc-7 {
	opacity: 0.7;
	
}
.opc-8 {
	opacity: 0.8;
}
.opc-9 {
	opacity: 0.9;
}

.wb-10 {
	width: 10%;
}
.wb-20 {
	width: 20%;
}
.wb-25 {
	width: 25%;
}
.wb-30 {
	width: 30%;
}
.wb-40 {
	width: 40%;
}
.wb-45 {
	width: 45%;
}
.wb-47 {
	width: 47%;
}
.wb-48 {
	width: 48%;
}
.wb-50 {
	width: 50%;
}
.wb-60 {
	width: 60%;
}
.wb-70 {
	width: 70%;
}
.wb-80 {
	width: 80%;
}
.wb-85 {
	width: 85%;
}
.wb-90 {
	width: 90%;
}
.wb-100 {
	width: 100%;
}

/* ==================
    hover
 ==================== */
.ss-hover-class {
  background-color: #ccc;
  opacity: 0.6;
}
.ss-hover-btn {
  transform: translate(2px, 2px);
}
.bold {
	font-weight: bold;
}
.no_text {
	white-space: nowrap;
}

.box-shadow {
	box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.1);
}

.po-ab {
	position: absolute;
}

.po_re {
	position: relative;
}


/* ==================
    底部安全区域
 ==================== */

.ss-safe-bottom {
  padding-bottom: 0;
  padding-bottom: calc(constant(safe-area-inset-bottom) / 5 * 3);
  padding-bottom: calc(env(safe-area-inset-bottom) / 5 * 3);
}

.safe-bottom {
  height: 0;
  height: calc(constant(safe-area-inset-bottom) / 5 * 3);
  height: calc(env(safe-area-inset-bottom) / 5 * 3);
}

$color:(
	main:$main-color,
	shadow-main:$shadow-main-color,
	page:$page-bg,
	text:$text-color,
	subtext:#94a3b8,
	white:#fff,
	black:#000,
	dark:$dark,
	dark2:$dark2,
	dark3:$dark3,
	dark5:$dark5,
	dark6:$dark6,
	dark9:$dark9,
	price:$price-color,
	price2:$price2,
	error:$err-color,
	success:$success,
	gold:$gold,
	bgjb:$bg-jb,
	ccc:#ccc,
	eee:$darkE,
	border:$border-color,
	input:$input,
	subtitle:$subtitle,
	c5:$C5
	);
@each $key,$val in $color {
  .fc-#{"" +$key}{
	color:$val;
  }
  .bg-color-#{"" +$key}{
	background-color:$val;
  }
  .bg-#{"" +$key}{
  	background:$val;
  }
}

/* ==================

    字体大小
	
 ==================== */

@for $i from 10 through 64 {
  .ss-font-#{$i} {
    font-size: $i + rpx;
  }
  .fs-#{$i} {
    font-size: $i + rpx;
  }
}
.font-w-500{
	font-weight: 500;
}
.font-w-400{
	font-weight: 400;
}
.font-w-600{
	font-weight: 600;
}
.font-w-700{
	font-weight: 700;
}

.po-re {
	position: relative;
}


/* ==================
    按钮
 ==================== */
.ss-reset-button {
  padding: 0;
  margin: 0;
  font-size: inherit;
  background-color: transparent;
  color: inherit;
  position: relative;
  border: 0rpx;
  /* #ifndef APP-NVUE */
  display: flex;
  /* #endif */
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: baseline;
  transform: translate(0, 0);
}
.ss-reset-button.button-hover {
  transform: translate(1px, 1px);
  background: none;
}

.ss-reset-button::after {
  border: none;
}

.tag {
	border-radius: 8rpx 8rpx 8rpx 8rpx;
	border: 2rpx solid $main-color;
	color: $main-color;
	font-weight: 400;
	font-size: 22rpx;
	padding: 4rpx 12rpx;
	border-radius: 8rpx;
	box-sizing: border-box;
	margin-left: 24rpx;
}


